package com.bank.manage.utils;

import cn.hutool.core.lang.UUID;
import com.bank.manage.model.BankAccessWalletRecord;
import org.apache.commons.lang3.StringUtils;

/**
 * UniqueUtils
 *
 * @author grl
 * @date 2024/4/1
 */
public class UniqueUtils {

    public static String generateRequestId(BankAccessWalletRecord record){
        String currentDate = LocalDateTimeUtils.getCurrentDateTime();
        String userNum = record.getUserNum();
        String accessDevice = record.getAccessDevice();
        UUID uuid = UUID.fastUUID();
        String uuidStr = uuid.toString().replaceAll("-", "");
        return currentDate + userNum + (StringUtils.isNotBlank(accessDevice) ? accessDevice : "") + uuidStr;
    }
}
